//
//  EBHGlobal.m
//  EBHDoctor
//
//  Created by 黄德玉 on 2019/11/16.
//  Copyright © 2019 DCloud. All rights reserved.
//

#import "EBHGlobal.h"

@implementation EBHGlobal

// iPhoneX、iPhoneXR、iPhoneXs、iPhoneXs Max等
// 判断刘海屏，返回YES表示是刘海屏
+ (BOOL)isNotchScreen {
    static BOOL hasGetScreenType = NO;
    static BOOL isLiuHai = NO;
    if (hasGetScreenType) {
        return isLiuHai;
    }
    hasGetScreenType = YES;
    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
        isLiuHai = NO;;
    }
    CGSize size = [UIScreen mainScreen].bounds.size;
    NSInteger notchValue = size.width / size.height * 100;
    if (216 == notchValue || 46 == notchValue) {
       isLiuHai = YES;
    }
    return  isLiuHai;
}

@end
